BEGIN;

ALTER TABLE DUTY.DUTYRECORDS ADD COLUMN worktimems BIGINT;
ALTER TABLE DUTY.DUTYRECORDS ADD COLUMN overtimems BIGINT;
CREATE ALIAS TIME2LONG FOR "org.ctstudio.common.h2.Functions.time2Long";
UPDATE DUTY.DUTYRECORDS SET worktimems=TIME2LONG(worktime) WHERE worktime IS NOT NULL AND worktimems IS NULL;
UPDATE DUTY.DUTYRECORDS SET overtimems=TIME2LONG(overtime) WHERE overtime IS NOT NULL AND overtimems IS NULL;
DROP ALIAS TIME2LONG;

COMMIT;